Rotations and Scaling

Introduction

In this article, we explore two of the most visually intuitive linear transformations in the plane:

You already know what a linear transformation is. Now we look at how specific matrices act on 2D space and how to interpret their geometric meaning.

What Are Rotations?

A rotation turns every point in the plane around the origin by some angle $\theta$.

The standard rotation matrix is: $$R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$$ Key properties:

Useful facts:

What Is Scaling?

Scaling stretches or shrinks objects.

A simple scaling matrix: $$S = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}$$ Effects:

Same for $b$ in the $y$‑direction.

Special case: uniform scaling $$kI = \begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix}$$ This stretches or shrinks equally in all directions.

Combining Rotations and Scaling

Because matrices represent linear transformations, we can compose them:

These are usually not the same matrix — order matters.

differences in rotation and scaling order

Geometric Interpretation

To understand a matrix, look at what it does to:

Rotations:

Scaling:

Examples

1. Rotation by $90^\circ$

$$R_{\pi/2} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$ Effect: turns every point counterclockwise by $90^\circ$.

2. Scaling by 2 in $x$ and 1/2 in $y$

$$S = \begin{pmatrix} 2 & 0 \\ 0 & 1/2 \end{pmatrix}$$ Effect: stretches horizontally, compresses vertically.

3. Uniform scaling by 3

$$3I = \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}$$ Effect: enlarges all shapes by a factor of 3.

Calculator

Creating rotation matrices

  • Rotation matrices can be craated using the $\operatorname{rotationMatrix}()$ function:
rotationMatrix(pi/2) rotationMatrix(90deg)

Creating scaling matrices

  • Scaling matrices are easy to create, so no helper functions exist for them
[a, 0; 0, b]

Exercises

(5–10 exercises, each with an import‑comment as required)

Exercises

  1. Compute $R_{\pi/2}(1,2)$ using $R_{\pi/2} = \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}$.

    Solution

    $$R_{\pi/2}(1,2) = (0\cdot1 - 1\cdot2,\; 1\cdot1 + 0\cdot2) = (-2,1)$$
  2. Describe the geometric effect of $S = \begin{pmatrix}3 & 0 \\ 0 & 1\end{pmatrix}$.

    Solution


    The matrix stretches space horizontally by a factor of 3 while leaving vertical lengths unchanged.
  3. Determine whether the transformation $T(x,y) = (2x,\, -3y)$ is a scaling transformation.

    Solution


    Yes. It scales the $x$‑direction by 2 and the $y$‑direction by $-3$ (a flip + stretch).
  4. Compute the result of applying a uniform scaling by $k=4$ to the vector $(1,-2)$.

    Solution

    $$4(1,-2) = (4,-8)$$
  5. Compute $R_\theta(1,0)$ for $\theta = \frac{\pi}{3}$.

    Solution

    $$R_{\pi/3}(1,0) = (\cos(\pi/3),\; \sin(\pi/3)) = \left(\frac12,\; \frac{\sqrt{3}}{2}\right)$$
  6. True or false: A rotation can change the length of a vector.

    Solution


    False. Rotations preserve length.
  7. Compute the composition $R_{\pi/2} S$ where $S = \begin{pmatrix}2 & 0 \\ 0 & 2\end{pmatrix}$.

    Solution

    $$S = \begin{pmatrix}2 & 0 \\ 0 & 2\end{pmatrix}$$ So $$R_{\pi/2} S = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 0 & -2 \\ 2 & 0 \end{pmatrix}$$